/*
 * Team Name: Team Sasquatch
 * Cody Sharff
 * Anthony Rios
 * Prince Kishore
 * Travis Drake
 */

package model;

/**
 * Simple enumeration used for describing the quality of an
 * item.
 * 
 * @author Cody Sharff
 *
 */
public enum Condition {
	POOR, SLIGHTLY_USED, ACCEPTABLE, GOOD, VERY_GOOD, LIKE_NEW, BRAND_NEW;
	
	public static Condition conditionFromString(String the_condition)
	{
        Condition to_return = null;
        if (the_condition.equalsIgnoreCase(POOR.toString()))
        {
            to_return = POOR;
        } else if (the_condition.equalsIgnoreCase(SLIGHTLY_USED.toString()))
        {
            to_return = SLIGHTLY_USED;
        } else if (the_condition.equalsIgnoreCase(ACCEPTABLE.toString()))
        {
            to_return = ACCEPTABLE;
        } else if (the_condition.equalsIgnoreCase(GOOD.toString()))
        {
            to_return = GOOD;
        } else if (the_condition.equalsIgnoreCase(VERY_GOOD.toString()))
        {
            to_return = VERY_GOOD;
        } else if (the_condition.equalsIgnoreCase(LIKE_NEW.toString()))
        {
            to_return = LIKE_NEW;
        } else if (the_condition.equalsIgnoreCase(BRAND_NEW.toString()))
        {

            to_return = BRAND_NEW;
        } 
        return to_return;
	}
}
